from celery import Celery
from datetime import timedelta
broker_redis='redis://127.0.0.1:6379/1'
backend_redis='redis://127.0.0.1:6379/2'
app=Celery('test2',broker=broker_redis,backend=backend_redis,include=['task01','task02'])
#时区
app.conf.timezone='Asia/Shanghai'
#是否使用utc时间
app.conf.enable_utc=False
app.conf.beat_schedule={
    #名字随便起
    'add-every-10-seconds':{
        'task':'task01.send_email',
        'schedule':timedelta(seconds=10),
        'args':['张三',]
    }
}